"use strict"

/**
 * MobileNet V4
 * https://ar5iv.labs.arxiv.org/html/2404.10518
 */

/**
 * @库导入
 */
// 导入tfjs和tfvis和库
import * as tf from "@tensorflow/tfjs"




function convBlock(x, filters, kernelSize, strides, blockId) {
  const channel_axis = 3;
  const x_skip = tf.layers.conv2d(
    x,
    filters,
    1,
    strides,
    'same',
    null,
    null,
    'conv2d_' + blockId + '_0'
  )
  x_skip = tf.layers.batchNormalization(x_skip, null, null, 'bn_' + blockId + '_0');
  
  x = tf.layers.conv2d(x, filters, kernelSize, strides, 'same', null, null, 'conv2d_' + blockId + '_1');
  x = tf.layers.batchNormalization(x, null, null, 'bn_' + blockId + '_1');
  x = tf.layers.activation(x, 'relu6');
  
  x = tf.layers.conv2d(x, filters, kernelSize, 1, 'same', null, null, 'conv2d_' + blockId + '_2');
  x = tf.layers.batchNormalization(x, null, null, 'bn_' + blockId + '_2');
  
  x = tf.add(x, x_skip);
  return x;
  }




/**
 * @模型定义
 */
const MobileNetV4 = tf.sequential()




// 默认导出
export default MobileNetV4